<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/painting/qbrush.cpp -->
<head>
  <title>Qt 4.3: QLinearGradient Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QLinearGradient Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QLinearGradient class is used in combination with <a href="qbrush.html">QBrush</a> to specify a linear gradient brush. <a href="#details">More...</a></p>
<pre> #include &lt;QLinearGradient&gt;</pre><p>Inherits <a href="qgradient.html">QGradient</a>.</p>
<ul>
<li><a href="qlineargradient-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qlineargradient.html#QLinearGradient">QLinearGradient</a></b> ()</li>
<li><div class="fn"/><b><a href="qlineargradient.html#QLinearGradient-2">QLinearGradient</a></b> ( const QPointF &amp; <i>start</i>, const QPointF &amp; <i>finalStop</i> )</li>
<li><div class="fn"/><b><a href="qlineargradient.html#QLinearGradient-3">QLinearGradient</a></b> ( qreal <i>x1</i>, qreal <i>y1</i>, qreal <i>x2</i>, qreal <i>y2</i> )</li>
<li><div class="fn"/>QPointF <b><a href="qlineargradient.html#finalStop">finalStop</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qlineargradient.html#setFinalStop">setFinalStop</a></b> ( const QPointF &amp; <i>stop</i> )</li>
<li><div class="fn"/>void <b><a href="qlineargradient.html#setFinalStop-2">setFinalStop</a></b> ( qreal <i>x</i>, qreal <i>y</i> )</li>
<li><div class="fn"/>void <b><a href="qlineargradient.html#setStart">setStart</a></b> ( const QPointF &amp; <i>start</i> )</li>
<li><div class="fn"/>void <b><a href="qlineargradient.html#setStart-2">setStart</a></b> ( qreal <i>x</i>, qreal <i>y</i> )</li>
<li><div class="fn"/>QPointF <b><a href="qlineargradient.html#start">start</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>8 public functions inherited from <a href="qgradient.html#public-functions">QGradient</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QLinearGradient class is used in combination with <a href="qbrush.html">QBrush</a> to specify a linear gradient brush.</p>
<p>Linear gradients interpolate colors between start and end points. Outside these points the gradient is either padded, reflected or repeated depending on the currently set <a href="qgradient.html#Spread-enum">spread</a> method:</p>
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/qlineargradient-pad.png" /></td><td><img src="images/qlineargradient-reflect.png" /></td><td><img src="images/qlineargradient-repeat.png" /></td></tr>
<tr valign="top" class="even"><td><a href="qgradient.html#Spread-enum">PadSpread</a> (default)</td><td><a href="qgradient.html#Spread-enum">ReflectSpread</a></td><td><a href="qgradient.html#Spread-enum">RepeatSpread</a></td></tr>
</table></p>
<p>The colors in a gradient is defined using stop points of the <a href="qgradient.html#QGradientStop-typedef">QGradientStop</a> type, i.e&#x2e; a position and a color. Use the <a href="qgradient.html#setColorAt">QGradient::setColorAt</a>() or the <a href="qgradient.html#setStops">QGradient::setStops</a>() function to define the stop points. It is the gradient's complete set of stop points that describes how the gradient area should be filled. If no stop points have been specified, a gradient of black at 0 to white at 1 is used.</p>
<p>In addition to the functions inherited from <a href="qgradient.html">QGradient</a>, the QLinearGradient class provides the <a href="qlineargradient.html#finalStop">finalStop</a>() function which returns the final stop point of the gradient, and the <a href="qlineargradient.html#start">start</a>() function returning the start point of the gradient.</p>
<p>See also <a href="qradialgradient.html">QRadialGradient</a>, <a href="qconicalgradient.html">QConicalGradient</a>, and <a href="demos-gradients.html">The Gradients Demo</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QLinearGradient"></a>QLinearGradient::QLinearGradient ()</h3>
<p>Constructs a default linear gradient with interpolation area between (0, 0) and (1, 1).</p>
<p>See also <a href="qgradient.html#setColorAt">QGradient::setColorAt</a>(), <a href="qlineargradient.html#setStart">setStart</a>(), and <a href="qlineargradient.html#setFinalStop">setFinalStop</a>().</p>
<h3 class="fn"><a name="QLinearGradient-2"></a>QLinearGradient::QLinearGradient ( const <a href="qpointf.html">QPointF</a> &amp; <i>start</i>, const <a href="qpointf.html">QPointF</a> &amp; <i>finalStop</i> )</h3>
<p>Constructs a linear gradient with interpolation area between the given <i>start</i> point and <i>finalStop</i>.</p>
<p>See also <a href="qgradient.html#setColorAt">QGradient::setColorAt</a>() and <a href="qgradient.html#setStops">QGradient::setStops</a>().</p>
<h3 class="fn"><a name="QLinearGradient-3"></a>QLinearGradient::QLinearGradient ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x2</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y2</i> )</h3>
<p>Constructs a linear gradient with interpolation area between (<i>x1</i>, <i>y1</i>) and (<i>x2</i>, <i>y2</i>).</p>
<p>See also <a href="qgradient.html#setColorAt">QGradient::setColorAt</a>() and <a href="qgradient.html#setStops">QGradient::setStops</a>().</p>
<h3 class="fn"><a name="finalStop"></a><a href="qpointf.html">QPointF</a> QLinearGradient::finalStop () const</h3>
<p>Returns the final stop point of this linear gradient in logical coordinates.</p>
<p>See also <a href="qlineargradient.html#setFinalStop">setFinalStop</a>() and <a href="qgradient.html#stops">QGradient::stops</a>().</p>
<h3 class="fn"><a name="setFinalStop"></a>void QLinearGradient::setFinalStop ( const <a href="qpointf.html">QPointF</a> &amp; <i>stop</i> )</h3>
<p>Sets the final stop point of this linear gradient in logical coordinates to <i>stop</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlineargradient.html#finalStop">finalStop</a>().</p>
<h3 class="fn"><a name="setFinalStop-2"></a>void QLinearGradient::setFinalStop ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the final stop point of this linear gradient in logical coordinates to <i>x</i>, <i>y</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlineargradient.html#start">start</a>().</p>
<h3 class="fn"><a name="setStart"></a>void QLinearGradient::setStart ( const <a href="qpointf.html">QPointF</a> &amp; <i>start</i> )</h3>
<p>Sets the start point of this linear gradient in logical coordinates to <i>start</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlineargradient.html#start">start</a>().</p>
<h3 class="fn"><a name="setStart-2"></a>void QLinearGradient::setStart ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the start point of this linear gradient in logical coordinates to <i>x</i>, <i>y</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlineargradient.html#start">start</a>().</p>
<h3 class="fn"><a name="start"></a><a href="qpointf.html">QPointF</a> QLinearGradient::start () const</h3>
<p>Returns the start point of this linear gradient in logical coordinates.</p>
<p>See also <a href="qlineargradient.html#setStart">setStart</a>() and <a href="qgradient.html#stops">QGradient::stops</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
